import { cloud, default as request } from "@/framework/utils/request";

/**
 * @description: 分页查询优惠券所有数据 /tMcpCoupon/page
 * @param data
 */
export function QueryCouponList(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/page`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 新增优惠券数据 /tMcpCoupon/add
 * @data
 */
export function AddCoupon(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/add`,
    method: "post",
    data,
  });
}

/**
 * @description: 修改优惠券数据 /tMcpCoupon/edit
 * @data
 */
export function EditCoupon(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/edit`,
    method: "post",
    data,
  });
}

/**
 * @description: 删除优惠券数据 /tMcpCoupon/delete
 * @data
 */
export function DeleteCoupon(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/delete`,
    method: "post",
    data,
  });
}

/**
 * @description: 获取优惠券单条数据详情 /tMcpCoupon/detail
 * @param data
 */
export function QueryCouponDetail(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/detail`,
    method: "get",
    params: data,
  });
}

/**
 * @description: 批量禁用启用优惠卷 /tMcpCoupon/batchUpdateStatus
 * @data
 */
export function batchUpdateCoupon(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/batchUpdateStatus`,
    method: "post",
    data,
  });
}

/**
 * @description: 获取优惠卷使用详情 /tMcpCoupon/userRecord
 * @param data
 */
export function QueryCouponUseDetail(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/userRecord`,
    method: "get",
    params: data,
  });
}


/**
 * @description: 获取会员列表 /user/list
 * @data
 */
export function QueryMemberList(data) {
  return request({
    url: `${cloud.mall}/user/list`,
    method: "post",
    data,
  });
}


/**
 * @description: 优惠卷发放接口 /tMcpCoupon/publishCoupon
 * @data
 */
export function DiscountCoupons(data) {
  return request({
    url: `${cloud.mall}/tMcpCoupon/publishCoupon`,
    method: "post",
    data,
  });
}

/**
 * @description: 商家优惠卷获取商品列表 /goods/getGoodsList
 * @param data
 */
export function QueryGoodsList(data) {
  return request({
    url: `${cloud.mall}/goods/getGoodsList`,
    method: "get",
    params: data,
  });
}


/**
 * @description: 商家优惠卷活动商品列表 /goods/getActivitiesGoods
 * @param data
 */
export function QueryActiveGoodsList(data) {
  return request({
    url: `${cloud.mall}/goods/getActivitiesGoods`,
    method: "get",
    params: data,
  });
}
